#pragma once

#include "Alice/ECS/System.hpp"
#include "Alice/Math/Direction.hpp"
#include "glm/glm.hpp"

namespace Alice
{

struct AABBComp;
struct TransformComp;

/*
    AABB 碰撞系统
    这个系统关注的组件：AABBComp，TransformComp
*/
class AABBSys : public System
{
    void OnUpdate();

    /*
        判断两个 AABBComp 是否碰撞
    */
    bool IsCollision(AABBComp& a, AABBComp& b, TransformComp& a_tf, TransformComp& b_tf);

    /*
        计算碰撞发生时 a 的方向
    */
    Direction CalCollisionDerection(glm::vec2& difference);
};

} // namespace Alice
